|
|
|
AssemblyAssembly Language is as low-level as programming gets. It involves writing directly to CPU registers and memory addresses, using integrated processor functions such as MOV and XOR. It is the hardest language to learn, since it takes a tremendous amount of code to perform even the most mundane tasks. A program with the same functionality can be written much more easily in a higher-level language such as Pascal or C. However, knowing some Assembly gives you tremendous insight into how computers operate. Practically, it is usually used in applications where speed is critical, such as intensive math calculations or writing to graphics boards. Assembly is also the language computer virii are written in. x86 Assembly "Hello World" Program title Hello World Program (hello.asm) ; This program displays "Hello, world!" .model small .stack 100h .code main proc mov ax,@data mov ds,ax mov ah,9 mov dx,offset hello_message int 21h mov ax,4C00h int 21h main endp .data hello_message db 'Hello, world!',0dh,0ah,'$' end main |
JavaJava is a very high-level, object-oriented programming language developed by Sun Microsystems. It is relatively easy to understand if you know C. Like C/C++, it is a compiled language, but it will run on a multitude of platforms. Java programs are compiled into class files that contain what is known as byte-codes, which are not specific to a certain operating system or processor. Java is used for writing both applets, which are mini-programs that run within web browsers, and applications, which are stand-alone. However there is a trade-off to Java's cross-platform functionality: it is quite slow compared to programs written in C.
Java "Hello World" Applet /* * The HelloWorldApp class implements an application that * simply displays "Hello World!" to the standard output. */ class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); //Display the string. } } |
PerlPerl is a high-level interpreted language derived from C and many other languages. It is extremely efficient at scanning and extracting data from text files and thus commonly used for CGI scripting. Perl is also excellent for shell-scripting on Unix systems, and is used in a variety of other applications. If you've programmed before in C it should be easy to learn. Perl "Hello World" Program #!/usr/local/bin/perl # .../Perl/hello.pl # # Purpose: Basic "Hello, world" program # Reference: Schwartz, Learning Perl, O'Reilly, p. 6. # # Illustrates: # First line is required, it means "This is a Perl program" # # denotes comments print "Basic Hello, world program.\n"; print "Hello, world!\n"; |
© 1998 Acid_burn